<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BabyOS: b_hal.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="baby_boy_93.528712871287px_1234786_easyicon.net.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">BabyOS
   &#160;<span id="projectnumber">V0.0.1</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',false,false,'search.php','Search');
});
/* @license-end */</script>
<div id="main-nav"></div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_b9223522bb56aee4ab59f7ba381d2163.html">bos</a></li><li class="navelem"><a class="el" href="dir_f8a0fa7de2fa8ec1cbca46d8cda2da54.html">hal</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">b_hal.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="b__hal_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="preprocessor">#ifndef __B_HAL_H__</span></div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="preprocessor">#define __B_HAL_H__</span></div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;</div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="preprocessor">#ifdef __cplusplus</span></div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160; <span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> {</div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="comment">/*Includes ----------------------------------------------*/</span></div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="b__config_8h.html">b_config.h</a>&quot;</span> </div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;<span class="preprocessor">#include &quot;stm32f1xx_hal.h&quot;</span></div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;</div><div class="line"><a name="l00065"></a><span class="lineno"><a class="line" href="group___h_a_l___exported___defines.html#ga9c64654d333d0c63a47d4610be2509e0">   65</a></span>&#160;<span class="preprocessor">#define FLS_PSIZE                   2048UL</span></div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;</div><div class="line"><a name="l00067"></a><span class="lineno"><a class="line" href="group___h_a_l___exported___defines.html#ga3df8c78e1d68d69f629630fb6095cec1">   67</a></span>&#160;<span class="preprocessor">#define FLASH_CS_RESET()            HAL_GPIO_WritePin(W25X_CS_GPIO_Port, W25X_CS_Pin, GPIO_PIN_RESET)</span></div><div class="line"><a name="l00068"></a><span class="lineno"><a class="line" href="group___h_a_l___exported___defines.html#gadc9743a09abcf9e1d203bdd5081db24a">   68</a></span>&#160;<span class="preprocessor">#define FLASH_CS_SET()              HAL_GPIO_WritePin(W25X_CS_GPIO_Port, W25X_CS_Pin, GPIO_PIN_SET)</span></div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;</div><div class="line"><a name="l00070"></a><span class="lineno"><a class="line" href="group___h_a_l___exported___defines.html#gac5645a8f806359e621559359dadfc7c5">   70</a></span>&#160;<span class="preprocessor">#define S_TX_PIN_SET()              HAL_GPIO_WritePin(SUART_TX_GPIO_Port, SUART_TX_Pin, GPIO_PIN_SET)</span></div><div class="line"><a name="l00071"></a><span class="lineno"><a class="line" href="group___h_a_l___exported___defines.html#gadd41bc5ddcf6f842928efc4f0d944a57">   71</a></span>&#160;<span class="preprocessor">#define S_TX_PIN_RESET()            HAL_GPIO_WritePin(SUART_TX_GPIO_Port, SUART_TX_Pin, GPIO_PIN_RESET)</span></div><div class="line"><a name="l00072"></a><span class="lineno"><a class="line" href="group___h_a_l___exported___defines.html#gac1fbe03efbe22feb97f198a4dd8b1237">   72</a></span>&#160;<span class="preprocessor">#define S_RX_PIN_READ()             HAL_GPIO_ReadPin(SUART_RX_GPIO_Port, SUART_RX_Pin)</span></div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;</div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;<span class="preprocessor">#if _DEBUG_ENABLE</span></div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;</div><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;<span class="preprocessor">#define b_log(...)       printf(__VA_ARGS__)</span></div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;</div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;<span class="preprocessor">#else</span></div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;</div><div class="line"><a name="l00090"></a><span class="lineno"><a class="line" href="group___h_a_l___exported___macros.html#gafc78b16ad8aebf30b9cabfc278cfb32a">   90</a></span>&#160;<span class="preprocessor">#define b_log(...)</span></div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;</div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;<span class="preprocessor">#endif    </span></div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;</div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;</div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;<span class="keywordtype">void</span> <a class="code" href="group___h_a_l___exported___functions.html#gac4b3d313f1c9c001234743725e491b9a">bHalEnterCritical</a>(<span class="keywordtype">void</span>); </div><div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;<span class="keywordtype">void</span> <a class="code" href="group___h_a_l___exported___functions.html#ga9b005cf96b043e836780e1cc1b9254fc">bHalExitCritical</a>(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;<span class="keywordtype">void</span> <a class="code" href="group___h_a_l___exported___functions.html#ga12c2eefdfcc84de397bba9c9f95882a5">bHalDelayMS</a>(uint16_t xms);</div><div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;<span class="keywordtype">void</span> <a class="code" href="group___h_a_l___exported___functions.html#ga252916ffe00f5745ac44905b50a3f412">bHalDelayUS</a>(uint16_t xus);  </div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;uint32_t <a class="code" href="group___h_a_l___exported___functions.html#gac8e750b2b439b1cc756a4076503738e4">bHalGetTick</a>(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;<span class="keywordtype">void</span> <a class="code" href="group___h_a_l___exported___functions.html#ga6bb2b0cf5092883eb8c51f9b8d4a5c78">bHalChipProtect</a>(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;<span class="keywordtype">void</span> <a class="code" href="group___h_a_l___exported___functions.html#gab4fede695cd2bf0ead21a2cc4ac02aaa">bHalGetSTM32MCUID</a>(uint32_t <span class="keywordtype">id</span>[3]);</div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;<span class="keywordtype">void</span> <a class="code" href="group___h_a_l___exported___functions.html#ga6f935a31e0b1cdb5905b565a5d3bb72f">bHalFeedWTD</a>(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;<span class="keywordtype">int</span> <a class="code" href="group___h_a_l___exported___functions.html#ga19179b3668da8153a34f5c57a43cef0b">bHalFlashWrite</a>(uint32_t address, uint8_t *pbuf, uint16_t len);</div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;<span class="keywordtype">int</span> <a class="code" href="group___h_a_l___exported___functions.html#ga9bbf639675e6f6028a969874d60acac3">bHalErasePage</a>(uint32_t addr);</div><div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;<span class="preprocessor">#ifdef __cplusplus</span></div><div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;    }</div><div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160; </div><div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;</div><div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;</div><div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;<span class="comment">/************************ Copyright (c) 2019 Bean *****END OF FILE****/</span></div><div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;</div><div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;</div><div class="ttc" id="group___h_a_l___exported___functions_html_gac8e750b2b439b1cc756a4076503738e4"><div class="ttname"><a href="group___h_a_l___exported___functions.html#gac8e750b2b439b1cc756a4076503738e4">bHalGetTick</a></div><div class="ttdeci">uint32_t bHalGetTick()</div><div class="ttdef"><b>Definition:</b> <a href="b__hal_8c_source.html#l00140">b_hal.c:140</a></div></div>
<div class="ttc" id="group___h_a_l___exported___functions_html_ga9b005cf96b043e836780e1cc1b9254fc"><div class="ttname"><a href="group___h_a_l___exported___functions.html#ga9b005cf96b043e836780e1cc1b9254fc">bHalExitCritical</a></div><div class="ttdeci">void bHalExitCritical()</div><div class="ttdoc">&lt;&lt; delay </div><div class="ttdef"><b>Definition:</b> <a href="b__hal_8c_source.html#l00120">b_hal.c:120</a></div></div>
<div class="ttc" id="group___h_a_l___exported___functions_html_ga6bb2b0cf5092883eb8c51f9b8d4a5c78"><div class="ttname"><a href="group___h_a_l___exported___functions.html#ga6bb2b0cf5092883eb8c51f9b8d4a5c78">bHalChipProtect</a></div><div class="ttdeci">void bHalChipProtect()</div><div class="ttdef"><b>Definition:</b> <a href="b__hal_8c_source.html#l00145">b_hal.c:145</a></div></div>
<div class="ttc" id="group___h_a_l___exported___functions_html_ga252916ffe00f5745ac44905b50a3f412"><div class="ttname"><a href="group___h_a_l___exported___functions.html#ga252916ffe00f5745ac44905b50a3f412">bHalDelayUS</a></div><div class="ttdeci">void bHalDelayUS(uint16_t xus)</div><div class="ttdef"><b>Definition:</b> <a href="b__hal_8c_source.html#l00132">b_hal.c:132</a></div></div>
<div class="ttc" id="group___h_a_l___exported___functions_html_ga6f935a31e0b1cdb5905b565a5d3bb72f"><div class="ttname"><a href="group___h_a_l___exported___functions.html#ga6f935a31e0b1cdb5905b565a5d3bb72f">bHalFeedWTD</a></div><div class="ttdeci">void bHalFeedWTD()</div><div class="ttdef"><b>Definition:</b> <a href="b__hal_8c_source.html#l00164">b_hal.c:164</a></div></div>
<div class="ttc" id="b__config_8h_html"><div class="ttname"><a href="b__config_8h.html">b_config.h</a></div></div>
<div class="ttc" id="group___h_a_l___exported___functions_html_ga12c2eefdfcc84de397bba9c9f95882a5"><div class="ttname"><a href="group___h_a_l___exported___functions.html#ga12c2eefdfcc84de397bba9c9f95882a5">bHalDelayMS</a></div><div class="ttdeci">void bHalDelayMS(uint16_t xms)</div><div class="ttdef"><b>Definition:</b> <a href="b__hal_8c_source.html#l00127">b_hal.c:127</a></div></div>
<div class="ttc" id="group___h_a_l___exported___functions_html_ga9bbf639675e6f6028a969874d60acac3"><div class="ttname"><a href="group___h_a_l___exported___functions.html#ga9bbf639675e6f6028a969874d60acac3">bHalErasePage</a></div><div class="ttdeci">int bHalErasePage(uint32_t addr)</div><div class="ttdef"><b>Definition:</b> <a href="b__hal_8c_source.html#l00197">b_hal.c:197</a></div></div>
<div class="ttc" id="group___h_a_l___exported___functions_html_ga19179b3668da8153a34f5c57a43cef0b"><div class="ttname"><a href="group___h_a_l___exported___functions.html#ga19179b3668da8153a34f5c57a43cef0b">bHalFlashWrite</a></div><div class="ttdeci">int bHalFlashWrite(uint32_t address, uint8_t *pbuf, uint16_t len)</div><div class="ttdef"><b>Definition:</b> <a href="b__hal_8c_source.html#l00179">b_hal.c:179</a></div></div>
<div class="ttc" id="group___h_a_l___exported___functions_html_gab4fede695cd2bf0ead21a2cc4ac02aaa"><div class="ttname"><a href="group___h_a_l___exported___functions.html#gab4fede695cd2bf0ead21a2cc4ac02aaa">bHalGetSTM32MCUID</a></div><div class="ttdeci">void bHalGetSTM32MCUID(uint32_t id[3])</div><div class="ttdef"><b>Definition:</b> <a href="b__hal_8c_source.html#l00170">b_hal.c:170</a></div></div>
<div class="ttc" id="group___h_a_l___exported___functions_html_gac4b3d313f1c9c001234743725e491b9a"><div class="ttname"><a href="group___h_a_l___exported___functions.html#gac4b3d313f1c9c001234743725e491b9a">bHalEnterCritical</a></div><div class="ttdeci">void bHalEnterCritical()</div><div class="ttdef"><b>Definition:</b> <a href="b__hal_8c_source.html#l00115">b_hal.c:115</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.14
</small></address>
</body>
</html>
